<?
layout("/inc/layout.html",{title:sysTitle}){
?>
<!-- <link rel="stylesheet" type="text/css" href="static/technological/layer/skin/layer.css"/>
<script src="http://www.jq22.com/jquery/jquery-1.10.2.js"></script>
<script src="static/technological/layer/layer.js"></script> -->
<script type="text/javascript" src="static/technological/my.js"></script>

<link rel="stylesheet" type="text/css" href="static/technological/my.css">
<div id="page-wrapper">
<div id="demo2" style="padding:15px;box-sizing:border-box;"></div>
<input id="workFlowId" style="display:none" value="">
<input id="inputType" style="display:none" value="">
<!-- <input id="submit" type="button" value='导出结果' onclick="Export()"/> -->
<textarea id="result" row="6" style="display:none"></textarea>
</div>
<?} ?>
<script>
	var property={
	headLabel:true,
	initLabelText:"审批流程",
	width:500,
	height:300,
	toolBtns:["start round","end round","task"],
	// toolBtns:["start round","end round","task","fork","join"],
	haveHead:true,
	headBtns:["save","undo","redo","reload"],//如果haveHead=true，则定义HEAD区的按钮
	haveTool:true,
	haveGroup:true,
	useOperStack:true
};
var remark={
	cursor:"选择指针",
	direct:"结点连线",
	start:"入口结点",
	"end":"结束结点",
	"task":"任务结点",
	// fork:"分支结点",
	// "join":"联合结点",
	group:"组织划分框编辑开关"
};
var demo;
var workFlowId =  ${workFlowId};
$(document).ready(function(){
	//alert(workFlowId);
	
	$("#workFlowId").val(workFlowId);
	demo=$.createGooFlow($("#demo2"),property);
	demo.setNodeRemarks(remark);
	demo.loadData(${jsondata});
});
var out;
function Export(){
    document.getElementById("result").value=JSON.stringify(demo.exportData());
   
	$.ajax({
		type : "post",
		url : "./saveWorkflowView.html",
		data : {
			"jsondata" : document.getElementById("result").value,
			"id" : ${workFlowId}
		},
		dataType : "json",
		success : function(data) {
			if(data.count != false){
					layer.msg('保存成功！');
				}else{
					layer.msg('保存失败！');
				}
		},
		error : function(data) {
			alert("请求失败");
		}
	});
				
}
</script>